/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo903;

/**
 *
 * @author Administrator
 */
import demo902.*;
import java.util.*;

public class StringDemo1 {

    public static void main(String[] args) {
        
        String names = "张三李四王五张六";
        char ns[]=names.toCharArray();
        //char ns[]={'张','三'};

        int m = 0, n = 0, k = 0;
        char name;
        for (int i = 0; i < ns.length; i++) {
            name = ns[i];
            // if(names.substring(i,i+1).equals("张"))
            if (name=='张') {
                m++;
            } else if (name=='李') {
                n++;
            } else if (name=='王') {
                k++;
            }

        }
        System.out.println(m);
        System.out.println(n);
        System.out.println(k);

    }
}

